/*
 * Copyright 2022 CloudWeGo Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	NickName  string `gorm:"column:nick_name;type:varchar(128);not null;default:''" json:"nick_name"`   // 用户名
	AvatarURL string `gorm:"column:avatar_url;type:varchar(128);not null;default:''" json:"avatar_url"` // 用户头像URL（修正了注释中的错误）
	WxOpenID  string `gorm:"column:wx_open_id;type:varchar(128)" json:"wx_open_id,omitempty"`           // 微信开放平台ID
	WxUnionID string `gorm:"column:wx_union_id;type:varchar(128)" json:"wx_union_id,omitempty"`         // 微信联合ID
}

func (u *User) TableName() string {
	return "t_users"
}
